package com.cskaoyan.market.controller.wx;

import com.cskaoyan.market.db.domain.MarketBrand;
import com.cskaoyan.market.service.wx.WxBrandService;
import com.cskaoyan.market.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author：Katherine
 * @Package：com.cskaoyan.market.controller.wx.teamwork
 * @Project：market
 * @name：AdminBrandController
 * @Date：2023/5/23 11:10
 * @Filename：AdminBrandController
 */
@RestController
@RequestMapping("/wx/brand")
public class WxBrandController {
    //注入了service
    @Autowired
    WxBrandService adminBrandService;

    @GetMapping("list")
    public Object list(Integer page,Integer limit,Integer brandId){
        //返回品牌列表
        List<MarketBrand> marketBrands = adminBrandService.list(page, limit);
        return ResponseUtil.okList(marketBrands);
    }

    @GetMapping("detail")
    public Object detail(Integer id){
        //返回品牌对象
        MarketBrand marketBrands = adminBrandService.detail(id);
        return ResponseUtil.ok(marketBrands);
    }


}
